<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>



    输入项目：<input  id="search"   name="search" >
    <button  type="submit" onclick="sub()">tij</button>



    <ul id="show">
        <li id="show1">
<!--            <script>alert("1")</script>-->
            123
        </li>

    </ul>


    <div id="777">
1
    </div>


    <script>console.log(document.cookie)</script>
<!--12345-->
<!--alert-->


<!--<script>alert("1")</script>-->

<script>
    function sub (){
        let a='<script>console.log(document.cookie)<\/script>';
        console.log(a)

        var elementById = document.getElementById("search");
        console.log(elementById.value)

        var show = document.getElementById("show");

        const childDiv3 = document.createElement('li');
        childDiv3.innerText=a;
        show.appendChild(childDiv3)

        var div = document.getElementById("777");
        const childDiv2 = document.createElement('li');
        childDiv2.innerText=a;
        div.appendChild(childDiv2)
    }
    // console.log(document.cookie)
</script>


</body>

</html>